package nuc98x

import (
	"errors"
	"openzbox.com/driver/conn/driver/driverreg"
)

// Present returns true if a TM AM335x processor is detected.

// driver implements periph.Driver.
type driver struct {
}

func (d *driver) String() string {
	return "nuc98x"
}

func (d *driver) Prerequisites() []string {
	return nil
}

func (d *driver) After() []string {
	return nil
}

func (d *driver) Init() (bool, error) {
	if !Present() {
		return false, errors.New("nuc98x CPU not detected")
	}
	return true, nil
}

func init() {
	if isArm {
		driverreg.MustRegister(&drv)
	}
}

var drv driver
